package com.hg.miaosha;

import lombok.Data;

/**
 * @Author: skh
 * @Date: 2019/10/16 16:04
 * @Description:
 */
@Data
public class R {

    private Integer code;

    private String message;

    private Object data;

    public static R success(Object data) {
        R r = new R();
        r.setCode(0);
        r.setMessage("success");
        r.setData(data);
        return r;
    }

    public static R error(String message) {
        R r = new R();
        r.setCode(-1);
        r.setMessage(message);
        return r;
    }
}
